﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ORS.OrderRobot.EFCore.Migrations
{
    /// <inheritdoc />
    public partial class config_2 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "isLogined",
                table: "Accounts",
                newName: "IsActive");

            migrationBuilder.RenameColumn(
                name: "AirLinesNo",
                table: "AccountBoardings",
                newName: "AirlinesNo");

            migrationBuilder.RenameColumn(
                name: "AirLines",
                table: "AccountBoardings",
                newName: "Airlines");

            migrationBuilder.AddColumn<bool>(
                name: "MointerProductEnable",
                table: "SystemConfigs",
                type: "tinyint(1)",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "RefreshTokenEnable",
                table: "SystemConfigs",
                type: "tinyint(1)",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AlterColumn<DateTime>(
                name: "LastLoginTime",
                table: "Accounts",
                type: "datetime(6)",
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "MointerProductEnable",
                table: "SystemConfigs");

            migrationBuilder.DropColumn(
                name: "RefreshTokenEnable",
                table: "SystemConfigs");

            migrationBuilder.RenameColumn(
                name: "IsActive",
                table: "Accounts",
                newName: "isLogined");

            migrationBuilder.RenameColumn(
                name: "AirlinesNo",
                table: "AccountBoardings",
                newName: "AirLinesNo");

            migrationBuilder.RenameColumn(
                name: "Airlines",
                table: "AccountBoardings",
                newName: "AirLines");

            migrationBuilder.AlterColumn<DateTime>(
                name: "LastLoginTime",
                table: "Accounts",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldNullable: true);
        }
    }
}
